import { createStore } from 'vuex';
import { RootState } from './type';
import user from '@/store/modules/user/user';
import permission from '@/store/modules/permission/permission';
import app from '@/store/modules/app/app';
import taskRequire from '@/store/modules/taskRequire/taskRequire';
import proRequire from '@/store/modules/proRequire/proRequire';
import versionControl from '@/store/modules/versionControl/versionControl';
import workbenchTaskList from '@/store/modules/workbenchTaskList/workbenchTaskList';
export default createStore<RootState>({
    modules: { user, permission, app, taskRequire, proRequire, versionControl, workbenchTaskList },
    getters: {
        token: (state) => state.user.token,
        userInfo: (state) => state.user.info,
        authInfo: (state) => state.user.authInfo,
        dicOptions: (state) => state.user.dicOptions,
        addRouters: (state) => state.permission.addRouters,
        versionTreeData: (state) => state.versionControl.versionTreeData,
        searchHistoryRecord: (state) => state.user.searchHistoryRecord,
        moveData: (state) => state.user.moveData,
        taskList: (state) => state.workbenchTaskList.list,
        currSelectIndex: (state) => state.workbenchTaskList.currSelectIndex,
        globalLoading: (state) => state.app.globalLoading
    }
});
